<%@ page language="java" import="java.util.*,java.sql.*"
	pageEncoding="UTF-8"%>
<%@page import="dal.SQLHelper"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>用户管理</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
	</head>
	<body>
		<h1>
			用户管理
		</h1>
		<br />
		<a href="addUser.jsp">新增用户</a>
		<a href="manager.jsp">返回管理员页面</a>
		<hr />
		<table border="1" width="80%">
			<tr>
				<td>
					用户名
				</td>
				<td>
					密码
				</td>
				<td>
					删除
				</td>
			</tr>
			<%
				String strurl = "jdbc:odbc:MyDB";
				try {
					String sql = "select * from juser order by username";
					ResultSet rs = SQLHelper.getResultSet(sql);
					while (rs.next()) {
			%>
			<tr>
				<td>
					<%
						out.print(rs.getString(1));
					%>
				</td>
				<td>
					<%
						out.print(rs.getString(2));
					%>
				</td>
				<td>
					<a href="deleteUser?username=<%out.print(rs.getString(1));%>">删除</a>
				</td>
			</tr>
			<%
				}
					SQLHelper.close();
				} catch (Exception e) {
					e.printStackTrace();
				}
			%>
		</table>
	</body>
</html>
